<template>
  <div>
    <el-row :gutter="10" style="margin-top: 20px;">
      <el-col :xs="24" :sm="24" :md="6" :lg="4">
        <div class="device-list addBox-line" @click="showDetailJson">
          <i class="el-icon-plus"></i>
          <span>add</span>
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :md="4" :lg="4" v-for="item in 10" :key="item">
        <div class="device-list" @click="showDetailJson">
          <div class="device-list-title"><img src="@/assets/images/Icon.png" alt="">Gateway 001</div>
          <div class="device-list-num">
            <p class="device-detail-title">ON</p>
            <div class="device-detail-swich">
              <el-switch
                v-model="value"
                active-color="#3a4cd5"
                inactive-color="#ff4949">
              </el-switch>
            </div>
            <p class="device-detail-samllTitle">4mouths a go</p>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "tabSetting",
  data(){
    return{
      value: true
    }
  },
  methods:{
    showDetailJson(){
      this.$emit('showDetailJson')
    }
  }
}
</script>

<style scoped>
.device-list {
  box-shadow: 0 2px 2px #ddd;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
  margin-bottom: 10px;
  background: #fff;
}

.device-list-title {
  display: flex;
  align-items: center;
  padding: 20px 0 10px 30px;
}

.device-list-num {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.device-detail-title {
color: rgb(0, 84, 254);
  margin: 10px 0;
}

.device-detail-samllTitle {
  color: rgb(116, 121, 140);
  font-size: 14px;
}

.addBox-line {
  height: 159px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.addBox-line i {
  font-size: 20px;
  height: 45px;
  width: 45px;
  text-align: center;
  line-height: 45px;
  margin-bottom: 13px;
  background: #eee;
  font-weight: bold;
  border-radius: 50%;
}
</style>
